package com.example.hms.controller;
import com.example.hms.entity.Customer;
import com.example.hms.service.CustomerService;
import com.example.hms.ulit.Result;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("customer")
public class CustomerController {
    //    动态注入下一层CustomerService（服务层）
    @Resource
    private CustomerService customerService;
    @RequestMapping(value = "/selectAllCustomer",method = RequestMethod.GET)
    public Result selectAllCustomer(String customerName, String phoneNumber, String identificationCard) {
        return customerService.selectAllCustomer(customerName,  phoneNumber, identificationCard);
    }
    @RequestMapping(value = "/insert",method = RequestMethod.GET)
    public Result insert(Customer customer) {
        return customerService.insert(customer);
    }
    @RequestMapping(value = "/update",method = RequestMethod.GET)
    public Result update(Customer customer) {
        return customerService.update(customer);
    }
    @RequestMapping(value = "/delete",method = RequestMethod.GET)
    public Result delete(Customer customer) {
        return customerService.delete(customer);
    }


}

